#
# Copyright 2023 The titan-search Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

configure_file(test_config.h.in ${PROJECT_SOURCE_DIR}/tests/test_config.h)
find_package(KTest REQUIRED)
kmcmake_cc_test(
        NAME raw_test
        MODULE hadar
        SOURCES text_dict_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME utf8_util_test
        MODULE hadar
        SOURCES utf8_util_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME utf8_string_slice_test
        MODULE hadar
        SOURCES utf8_string_slice_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME config_test
        MODULE hadar
        SOURCES config_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME command_line_convert_test
        MODULE hadar
        SOURCES command_line_convert_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME marisa_dict_test
        MODULE hadar
        SOURCES marisa_dict_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)


kmcmake_cc_test(
        NAME conversion_chain_test
        MODULE hadar
        SOURCES conversion_chain_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME conversion_test
        MODULE hadar
        SOURCES conversion_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME darts_dict_test
        MODULE hadar
        SOURCES darts_dict_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME dict_group_test
        MODULE hadar
        SOURCES dict_group_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME binary_dict_test
        MODULE hadar
        SOURCES binary_dict_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME phrase_extract_test
        MODULE hadar
        SOURCES phrase_extract_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME serialized_values_test
        MODULE hadar
        SOURCES serialized_values_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME max_match_segmentation_test
        MODULE hadar
        SOURCES max_match_segmentation_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME simple_converter_test
        MODULE hadar
        SOURCES simple_converter_test.cc
        LINKS
        hadar::hadar_static
        KTest::ktest
        KTest::ktest_main
        ${KMCMAKE_DEPS_LINK}
)
